<?php
class IndexAction extends CommonAction {

    public function index()
    {
        $query = mysql_query("select version() as ver");
        $this->assign(
            array(
                'phpversion' => PHP_VERSION,
                'mysqlversion' => $this->_getMysqlVersion(),
                'max_upload' => ini_get('file_uploads') ? ini_get('upload_max_filesize') : '上传功能未开启',
            )
        );
        $this->display();
    }

    public function admin()
    {
        $this->display();
    }


    // 获取mysql版本
    private function _getMysqlVersion()
    {
        $model = D('Admin');
        $version = $model->query("select version() as v");
        return $version[0]['v'];
    }
}